// components/page/images/index.js
let windowWidth = xhs.getSystemSetting().windowWidth;
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    imgSrc: {
      type: String,
      value: '',
      observer(imgSrc) {
        if (imgSrc) {
          let imgWidth = (windowWidth - this.data.spaceNum) / this.data.imgNumber + 'px',
            node = [{
              name: 'img',
              attrs: {
                src: imgSrc,
                style: 'max-width:100%;vertical-align: middle;width:100%;max-height:100%;float:left;height: 100%;'
              }
            }];
          this.setData({
            imgWidth,
            node
          });
        }
      }
    },
    scale: {
      type: Number,
      value: 0
    },
    spaceNum: {
      type: Number,
      value: 0
    },
    imgNumber: {
      type: Number,
      value: 0
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    imgWidth: 0,
    node: []
  }
});